package com.bff.gaia.mix.api.xjoin2.client.rdb.all;

import com.bff.gaia.mix.api.xjoin2.client.rdb.table.RdbSideTableInfo;
import com.bff.gaia.mix.api.xjoin2.core.side.SideTableInfo;
import com.bff.gaia.mix.api.xjoin2.core.table.FieldInfo;
import com.bff.gaia.mix.api.xjoin2.core.table.JoinInfo;
import com.bff.gaia.mix.api.xjoin2.core.table.StreamTableInfo;
import com.bff.gaia.mix.api.xjoin2.core.table.XjoinInfo;

import java.util.List;

public class RdbAllXjoinInfo extends XjoinInfo {


	public RdbAllXjoinInfo(StreamTableInfo streamTableInfo, SideTableInfo sideTableInfo, JoinInfo joinInfo, List<FieldInfo> outFieldInfoList) {
		super(streamTableInfo, sideTableInfo, joinInfo, outFieldInfoList);
	}

	@Override
	public void buildQuery(JoinInfo joinInfo, SideTableInfo sideTableInfo) {
		RdbSideTableInfo rdbSideTableInfo = (RdbSideTableInfo) sideTableInfo;

		sqlQuery = "select ${selectField} from ${tableName} ";
		sqlQuery = sqlQuery
			.replace("${tableName}", rdbSideTableInfo.getTableName())
			.replace("${selectField}", sideSelectFields);
		System.out.println("---------side_exe_sql-----\n" + sqlQuery);
	}
}